
const {ccclass, property} = cc._decorator;
import Global = require("./GlobalEvents");

@ccclass
export default class NewClass extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        let self = this;
        // 加载背景 独立的SpriteFrame           
        let bgurl =  Global.BGpics[Global.BGpic];
        //cc.log(bgurl);

        cc.loader.loadRes(bgurl, cc.SpriteFrame, function (err, spriteFrame) 
        {            
            //self.node.getChildByName("bg").getComponent(cc.Sprite).spriteFrame = spriteFrame;            
            self.getComponent(cc.Sprite).spriteFrame = spriteFrame; 
        });
    }

    start () {

    }

    // update (dt) {}
}
